Skip to content

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Apr 4, 2020

This will still catch mistakes in bad intrinsic/foreign-item shims, which is the main source of errors here.

Fixes #70723
r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 4, 2020
@RalfJung RalfJung force-pushed the ctfe-loop branch 2 times, most recently from 8e736f2 to f8b6e83 Compare April 5, 2020 08:16
@bors

This comment has been minimized.

@@ -0,0 +1,5 @@
#![feature(const_loop)]

static _X: () = loop {}; //~ ERROR could not evaluate static initializer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how long does this test take? If more than a second, please lower the step limit

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It takes not even 200ms here:

$ time rustc +rustc.2-s1 src/test/ui/consts/const-eval/issue-70723.rs 
error[E0080]: could not evaluate static initializer
 --> src/test/ui/consts/const-eval/issue-70723.rs:3:17
  |
3 | static _X: () = loop {}; //~ ERROR could not evaluate static initializer
  |                 ^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0080`.

real    0m0,125s
user    0m0,064s
sys     0m0,029s

@oli-obk
Copy link
Contributor

oli-obk commented Apr 6, 2020

r=me after ensuring that the new test doesn't consume too much time

@RalfJung
Copy link
Member Author

RalfJung commented Apr 6, 2020

@bors r=oli-obk

@bors
Copy link
Collaborator

bors commented Apr 6, 2020

📌 Commit e92bde3 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 6, 2020
@bors
Copy link
Collaborator

bors commented Apr 6, 2020

⌛ Testing commit e92bde3 with merge bd18bc9...

@bors
Copy link
Collaborator

bors commented Apr 6, 2020

☀️ Test successful - checks-azure
Approved by: oli-obk
Pushing bd18bc9 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 6, 2020
@bors bors merged commit bd18bc9 into rust-lang:master Apr 6, 2020
@RalfJung RalfJung deleted the ctfe-loop branch April 7, 2020 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE with #![feature(const_loop)] static _X: () = loop {};
4 participants